<?php

/**
 * Tasacamb form base class.
 *
 * @method Tasacamb getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTasacambForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'fecha'   => new sfWidgetFormInputHidden(),
      'moneda1' => new sfWidgetFormInputHidden(),
      'moneda2' => new sfWidgetFormInputHidden(),
      'monto'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'fecha'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getFecha()), 'empty_value' => $this->getObject()->getFecha(), 'required' => false)),
      'moneda1' => new sfValidatorPropelChoice(array('model' => 'Moneda', 'column' => 'id', 'required' => false)),
      'moneda2' => new sfValidatorPropelChoice(array('model' => 'Moneda', 'column' => 'id', 'required' => false)),
      'monto'   => new sfValidatorNumber(),
    ));

    $this->widgetSchema->setNameFormat('tasacamb[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Tasacamb';
  }


}
